package homework3;

import java.util.Scanner;

//获取一个数二进制序列中所有的偶数位和奇数位， 分别输出二进制序列
public class P8 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int odd = 0, even = 0;
        //假设最低位作为偶数位
        while (sc.hasNextInt()) {
            int n = sc.nextInt();
            System.out.println("偶数序列为");
            for (int i = 30; i >= 0; i -= 2) {
                System.out.print((n >>> i) & 1);
            }
            System.out.println();
            System.out.println("奇数序列为");
            for (int i = 31; i >= 1; i -= 2) {
                System.out.print((n >>> i) & 1);
            }
            System.out.println();
        }
        sc.close();
    }
}
